﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FDSimpleModelGenerator.IRepositories
{
    /// <summary>
    /// 生成Sql
    /// </summary>
    public interface IGenerateDbSql
    {
        /// <summary>
        /// 插入 表名对应于T名称，或TableAttribute的Name
        /// 生成模式化语句 值项为参数 @ParamName
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="ignoreColumns">忽略的列</param>
        /// <returns></returns>
        string GetInsertString<T>(params string[] ignoreColumns);

        ///// <summary>
        ///// 插入
        ///// </summary>
        ///// <param name="tableName">表名</param>
        ///// <param name="condition"></param>
        ///// <param name="ignoreColumns"></param>
        ///// <returns></returns>
        //string GetInsertString(string tableName, string condition, params string[] ignoreColumns);

        /// <summary>
        /// 更新  表名对应于T名称，或TableAttribute的Name
        /// 生成模式化语句 值项为参数 @ParamName
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="condition"></param>
        /// <param name="ignoreColumns"></param>
        /// <returns></returns>
        string GetUpdateString<T>(string condition, params string[] ignoreColumns);

        //string GetUpdateString(string tableName, string condition, params string[] ignoreColumns);

        /// <summary>
        /// 查询 表名对应于T名称，或TableAttribute的Name
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="condition"></param>
        /// <param name="specifiedColums">指定的列，不指定则全部列</param>
        /// <returns></returns>
        string GetQueryString<T>(string condition, params string[] specifiedColums);

        /// <summary>
        /// 删除 表名对应于T名称，或TableAttribute的Name
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="condition"></param>
        /// <returns></returns>
        string GetDeleteString<T>(string condition);
    }
}
